package erfgame.core.world.terrain.color;


import erfgame.core.world.World;
import erfgame.core.world.terrain.GridSettings;
import erfgame.core.world.terrain.TerrainColorSource;
import erfgame.core.world.terrain.TerrainColorSourceFactory;

public class GridTerrainColorSourceProxyFactory implements
		TerrainColorSourceFactory {
	
	private TerrainColorSourceFactory proxied;
	private TerrainColorSourceFactory gridColorSourceFactory;
	private GridSettings gridSettings;
	
	public GridTerrainColorSourceProxyFactory( 
			TerrainColorSourceFactory proxied,
			TerrainColorSourceFactory gridColorSourceFactory, 
			GridSettings gridSettings
	) {
		this.proxied = proxied;
		this.gridColorSourceFactory = gridColorSourceFactory;
		this.gridSettings = gridSettings;
	}

	public TerrainColorSource createColorSource(World world) {
		TerrainColorSource terrainSource;
		terrainSource = this.proxied.createColorSource(world);
		TerrainColorSource gridSource;
		gridSource = this.gridColorSourceFactory.createColorSource(world);
		return new GridTerrainColorSourceProxy(
				terrainSource, 				
				gridSource, 
				world, 
				gridSettings
		);
	}

}
